//
// Created by user on 2025/7/31.
//

#ifndef HELLOC_METHOD_H
#define HELLOC_METHOD_H

#include "systemc"
#include <iostream>
using namespace std;
using namespace sc_core;

class Method : public sc_module {
public:

    Method(sc_module_name name) : sc_module(name) {
        SC_THREAD(thread);
        SC_METHOD(method);
    }


    void thread(){
        int idx = 0;
        while (true){
            cout<< "thread " << idx++ <<  " @ " << sc_time_stamp() << endl;
            wait(1, SC_SEC);
        }
    }

    void method(){
        int idx = 0;
        cout<< "method " << idx++ <<  " @ " << sc_time_stamp() << endl;
        next_trigger(1, SC_SEC);
    }

};


#endif //HELLOC_METHOD_H
